import request from '@/utils/request'

// 查询小区单元管理列表
export function listCommunityUnit(query) {
  return request({
    url: '/system/communityUnit/list',
    method: 'get',
    params: query
  })
}
// 根据小区id获取单元列表
export function getListByCommunity(query) {
  return request({
    url: '/system/communityUnit/getListByCommunity',
    method: 'get',
    params: query
  })
}
// 查询小区单元管理详细
export function getCommunityUnit(id) {
  return request({
    url: '/system/communityUnit/' + id,
    method: 'get'
  })
}

// 新增小区单元管理
export function addCommunityUnit(data) {
  return request({
    url: '/system/communityUnit',
    method: 'post',
    data: data
  })
}

// 修改小区单元管理
export function updateCommunityUnit(data) {
  return request({
    url: '/system/communityUnit',
    method: 'put',
    data: data
  })
}

// 删除小区单元管理
export function delCommunityUnit(id) {
  return request({
    url: '/system/communityUnit/' + id,
    method: 'delete'
  })
}

// 导出小区单元管理
export function exportCommunityUnit(query) {
  return request({
    url: '/system/communityUnit/export',
    method: 'get',
    params: query
  })
}
